package com.likl.service.impl;

import com.likl.service.MessageService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

/**
 * ClassName:springboot_study
 * Description:
 *
 * @Create: 2024/7/17 9:52
 * @author: likl
 * @e-mail: likl1102@foxmail.com
 * @QQ: 2514927731
 */
@Service
public class MessageServiceImpl implements MessageService {

    private ArrayList<String> msgList = new ArrayList<>();

    @Override
    public void sendMessage(String id) {
        System.out.println("此业务订单已进入消息队列处理" + id);
        msgList.add(id);
    }

    @Override
    public String doMessage() {
        String id = msgList.remove(0);
        System.out.println("此业务订单已处理完毕" + id);
        return id;
    }
}
